<?php

namespace App\Libraries;
use App\Libraries\UploadApp;
use Illuminate\Support\Facades\DB;

class upload{

    /*
     * parameter  参数
     */
    public function up(){

        $file      = $_FILES['file'];
        $data = array();
        foreach ($file as $key => $value){
            foreach ($value as $k  => $v){
                $data[$k][$key]     = $v;
            }
        }
        return $data;
       /* $rand = rand(1000, 9999);
        for ($i=0;$i<count($data);$i++){
            $parameter    = $image ->upload($data[$i],date('YmdHis').$i.$rand);
        }
        return $parameter;*/
    }


    public function value($data,$i){
        $image     = new UploadApp();
        $rand = rand(1000, 9999);
        $parameter    = $image ->upload($data[$i],date('YmdHis').$i.$rand);
        return $parameter;
    }
}